<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../common/tag.jsp"%>
<ul class="nav nav-tabs">
    <li class="active m_swift" id="m_undo" onclick="swift(this)" >
        <a class="btn">
            待处理任务
            <span class="badge">${unhandledMissions.size()}</span>
        </a>
    </li>
    <li class="m_swift" id="m_done" onclick="swift(this)">
        <a class="btn">
            已完成任务
            <span class="badge">${finishedMissions.size()}</span>
        </a>
    </li>

</ul>
<ul id="m-items">

    <c:forEach items="${unhandledMissions}" var="m">
        <c:if test="${unhandledMissions.size()==0}">
            <li class="m_undo" style="list-style-type: none">
                无待处理项目
            </li>
        </c:if>
        <li class="m_undo">
            任务编号：${m.missionId}
            <br/>
            项目名：${m.projectName}
            <br/>
            指派人：${m.originatorName}
            <br/>
            发布日期：<fmt:formatDate value="${m.generateDate}" pattern="yyyy年MM月dd日hh点mm分"/>
            <br/>
            <a class="home_b_item btn" style="cursor: pointer;margin-left: 200px" onclick="missionDetail(${m.missionId})">
                查看详情 »»
            </a>
        </li>
    </c:forEach>
    <c:forEach items="${finishedMissions}" var="m">
        <li class="m_done hidden">
            任务编号：${m.missionId}
            <br/>
            项目名：${m.projectName}
            <br/>
            指派人：${m.originatorName}
            <br/>
            发布日期：<fmt:formatDate value="${m.generateDate}" pattern="yyyy年MM月dd日hh点mm分"/>
            <br/>
            <a class="home_b_item btn" style="cursor: pointer;margin-left: 200px" onclick="missionDetail(${m.missionId})">
                查看详情 »»
            </a>
        </li>
    </c:forEach>
</ul>
<script type="application/javascript">
    function missionDetail(missionId){
        home.b.getMissionById(missionId);
    }
    function swift(node){
        $(".m_swift").removeClass("active");
        $("#"+node.id).addClass("active");
        $("#m-items li").addClass("hidden");
        $("."+node.id).removeClass("hidden");
    }
</script>